package com.zretc.point.service;

import com.zretc.api.pojo.User;
import com.zretc.common.entity.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


@Component
@FeignClient(name = "sns-users-service")
public interface UserFeignClient {
    @GetMapping("/users/getUserById")
    User getUserInfoById(@RequestParam("userId") Integer userId);

    @GetMapping("/users/getUserByUsername")
    User getUserInfoByUsername(@RequestParam("userName") String userName);

    @GetMapping("/users/getUserPoint")
    Integer getPoint(@RequestParam("userId") Integer userId);

    @PostMapping("/users/updatePointOrReputation")
    RespResult updatePointOrReputation(@RequestBody User user);

    @GetMapping("/users/getUserReputation")
    Integer getReputation(@RequestParam("userId") Integer userId);
}
